﻿Imports SponsorshipLogic

Public Class frmLogin

    Private _LoginAttempts

    Private Sub DoLogin() Handles btnLogin.Click
        If User.Authenticate(Username.Text, Password.Text) Then

            Me.Close()

        Else
            _LoginAttempts += 1
            If _LoginAttempts < 3 Then

                MessageBox.Show("Login failed. please try again.")

            Else

                MessageBox.Show("Login failed. no further attempts allowed")
                Application.Exit()

            End If
        End If
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Application.Exit()
    End Sub

End Class
